package com.ffms.servlet; /**
 * @author 从卿
 * @create 2022/3/8-22:20
 */

import com.ffms.entity.FamilyMember;
import com.ffms.service.AdminService;
import com.ffms.service.impl.AdminServiceImpl;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.util.List;

@WebServlet("/FmShouruServlet")
public class FmShouruServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doPost(request, response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //1.获取用户请求数据

        //2.调用业务层调取成员信息
        AdminService adminService = new AdminServiceImpl();
        List<FamilyMember> familyMemberList = adminService.findAllMember();
        //3.跳转到显示成员页面
        request.setAttribute("familyMemberList", familyMemberList);
        request.getRequestDispatcher("familymember/shouru.jsp").forward(request, response);
    }
}
